Object-Oriented Programming Core Concepts

Object-oriented programming (OOP) is a programming paradigm that organizes code around the concept of "objects", which are instances of classes that encapsulate data and procedures. OOP promotes concept such as encapsulation, inheritance, and polymorphism, making code more modular, reusable, and flexible for easier management of complex systems. In this post, we are going to explore the key concepts used in OOP.

Object

Class

Inheritance

Warning

In the Java programming language, EACH CLASS IS ALLOWED TO HAVE ONE DIRECT SUPERCLASS. But each superclass has the potential for an unlimited number of subclasses

	class MountainBike **extends** Bicycle {
	
    // new fields and methods defining 
    // a mountain bike would go here
	
}
//This gives `MountainBike` all the same fields and methods as `Bicycle`, yet allows its code to focus exclusively on the features that make it unique

Interface

References